export interface AnyObject {
  [key: string]: unknown;
}

export interface Options {
  value: unknown;
  label: string;
}

export interface NodeOptions extends Options {
  children?: NodeOptions[];
}

export interface GetParams {
  body: null;
  type: string;
  url: string;
}

export interface PostData {
  body: string;
  type: string;
  url: string;
}

export interface Pageable {
  page: number
  size: number
}

export interface Pagination<T> {
  records: T[]
  current: number
  size: number
  total: number
  pages: number
}

export type TimeRanger = [string, string];

export interface GeneralChart {
  xAxis: string[];
  data: Array<{ name: string; value: number[] }>;
}

/**
 * 树形数据节点
 */
export interface TreeNode {
  id?: number
  parentId?: number
  order?: number
  children?: TreeNode[]
  disabled?: boolean
}

export enum Operation {
  PREVIEW = '预览',
  CREATE = '新增',
  UPDATE = '修改'
}

export interface DataModel {
  visible: boolean
  title: string
  disabled: boolean
  submit: boolean
  type?: Operation
}
